import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';

@Injectable()
export class AuthService {
    private readonly jwtService: JwtService;
    constructor(jwtService: JwtService) {
        this.jwtService = jwtService;
    }

    /**
     * jwt签证
     * @param admin 
     * @returns 
     */
    async certificate(admin: any) {
        const payload = { username: admin.username };
        const token = this.jwtService.sign(payload);
        return token
    }


}
